//
//  otherCell.m
//  TabBar
//
//  Created by 陈德锋 on 16/4/16.
//  Copyright © 2016年 陈德锋. All rights reserved.
//

#import "otherCell.h"

@implementation otherCell

+ (instancetype)otherCellWithTableView:(UITableView *)tableView
{
    static NSString *ID = @"otherCell";
    otherCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell = [[otherCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
    }
    return cell;
}

-(instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self)
    {
        self.contentView.backgroundColor = [UIColor whiteColor];
        //        self.contentView.frame = CGRectMake(0, 20, [[UIScreen mainScreen]bounds].size.width, 70);
        _headimage = [[UIImageView alloc] initWithFrame:CGRectZero];
        [self.contentView addSubview:_headimage];
        
        _lable = [[UILabel alloc] initWithFrame:CGRectZero];
        _lable.font = [UIFont systemFontOfSize:16.0];
        [self.contentView addSubview:_lable];
        
        
    }
    return self;
}
-(void) setInderow:(IndexRow *)inderow
{
    _inderow = inderow;
    if (_inderow) {
        NSString *imageName = [NSString stringWithFormat:@"%@",_inderow.image];
        self.headimage.image = [UIImage imageNamed:imageName];
        self.lable.text = _inderow.lable;
    }

}

-(void) layoutSubviews
{
    [super layoutSubviews];
    _headimage.frame =CGRectMake(8, 10, 25, 25);
    
    _lable.frame = CGRectMake(45, 10, 70, 25);
}

@end
